#ifndef KEY_H_
#define KEY_H_
#include <iostream>
using namespace std;
class Key{
public:
	Key()
	{
		keystat=-1;
	}
	void Down(unsigned char c)
	{
		keystat=1;
		keyCur=c;
		
		if (c>='A'&&c<='Z')
			keyCur=c+('a'-'A');
	}
	void Up()
	{
		keystat=-1;
	}
	bool isDown()
	{
		return keystat>0;
	}
	bool isKey(unsigned char c)
	{
		
		if (keystat<=0)return false;
		if (c==keyCur)return true;
			return false;
	}
private:
	int keystat;
	unsigned char keyCur;
};
#endif /*KEY_H_*/
